/*
 * @Author: chenhuanhuan 2925102113@qq.com
 * @Date: 2024-12-13 17:50:09
 * @LastEditors: chenhuanhuan 2925102113@qq.com
 * @LastEditTime: 2025-01-15 12:25:04
 * @FilePath: \hbzc-groupmeal-center-web\src\api\Spu.ts
 */
import request from "@/utils/newrequst";

// SPU类别树结构
export const getSpuClassTree = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu-class/tree`, method: "post", data: data,
  });
};
// 分页查询SPU类别
export const getSpuClassList = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu-class/page`, method: "post", data: data,
  });
};

// 分页查询SPU列表
export const getSpuInfoList = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu/page`, method: "post", data: data,
  });
};

// 添加spu
export const addSpuInfo = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu/add`, method: "post", data: data,
  });
};

// 修改SPU
export const setSpuInfo = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu/edit`, method: "post", data: data,
  });
};

// 生成SPU编码
export const getSpuCode = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu/generate-spu-code`, method: "post", data: data,
  });
};

// 校验SPU名称是否存在
export const getCheckSpuName = (data: any = {}) => {
  return request({
    url: `/base/v1/public/spu/check-name-exist`, method: "post", data: data,
  });
};

// 删除匹配SPU
export const deleteMatchSpu = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/delete-match-spu`, method: "post", data: data,
  });
};
//分页查询SPU匹配SKU
export const getSpuMatchSku = (data: any = {}) => {
  return request({
    url: `/base/v1/public/sku/matched-page`, method: "post", data: data,
  });
};

